package com.framework.web.bus.repository;

import com.framework.web.bus.domain.Cart;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
* @Title: Repository
* @Description: 购物车
* @author fusf
* @date 2016-09-11
* @version V1.0
*
*/
public interface CartRepository extends JpaRepository<Cart, String>,
JpaSpecificationExecutor<Cart> {
    /**
     * 根据用户和商品Id查询
     * @param userId
     * @param goodsId
     * @return
     */
    public List<Cart> findByUserIdAndGoodsId(String userId,String goodsId);

     /**
     * 根据用户Id查询
     * @param userId
     * @return
     */
    public List<Cart> findByUserId(String userId);

}